import request from "@/utils/request";

// 新增预支付订单信息
export function createPreOrder(data) {
  return request({
    url: "/business/registerPaymentOrder/createPreOrder",
    method: "post",
    data: data,
  });
}

// 查询预支付订单信息
export function getPreOrderInfo(orderId) {
  return request({
    url: `/business/registerPaymentOrder/getInfo`,
    method: "post",
    data: { orderId },
  });
}

// 查询预支付订单信息列表
export function listAllOrder(data) {
  return request({
    url: `/business/registerPaymentOrder/list`,
    method: "post",
    data: data,
  });
}

// 退款
export function refundOrder(data) {
  return request({
    url: "/business/registerPaymentOrder/addRefundApply",
    method: "post",
    data: data,
  });
}

// 退款审核
export function refundReview(data) {
  return request({
    url: "/business/registerPaymentOrder/processApproval",
    method: "post",
    data: data,
  });
}

// 导出订单
export function exportOrder(query) {
  return request({
    url: "/business/registerPaymentOrder/export",
    method: "post",
    responseType: "blob",
    data: query,
  });
}

// 统计
export function getCountOrder() {
  return request({
    url: `/business/registerPaymentOrder/queryByStat`,
    method: "post",
    data: {},
  });
}

// 科室统计列表
export function getDepartmentStatList(data) {
  return request({
    url: `/business/registerPaymentOrder/queryByDept`,
    method: "post",
    data: data,
  });
}

// 节点上查询订单信息
export function getInfoByRegisterId(registerId) {
  return request({
    url: `/business/registerPaymentOrder/getInfoByRegisterId`,
    method: "post",
    data: { registerId },
  });
}
